package com.megvii.koala.presenter;

import com.megvii.koala.activity.SimpleWebViewActivity;
import com.megvii.koala.activity.params.SimpleWebViewParam;
import com.megvii.koala.base.KoalaPresenter;

/**
 * Created by linyue on 16/3/2.
 */
public class SimpleWebViewPresenter extends KoalaPresenter<SimpleWebViewActivity>
        implements SimpleWebViewActivity.SimpleWebViewListener
{
    @Override
    protected void onCreated()
    {
        super.onCreated();
        viewHolder.setListener(this);
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        SimpleWebViewParam param = viewHolder.getActivityParam();
        if (param != null)
        {
            viewHolder.setTitleText(param.title);
            viewHolder.loadUrl(param.url);
        }
    }

    @Override
    public void onClickClose()
    {
        viewHolder.finish();
    }
}
